Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify jspm dependencies for moment #234

Merged
merged 1 commit into from
Sep 29, 2015
Merged

Conversation

lookfirst
Copy link
Contributor

No description provided.

timrwood added a commit that referenced this pull request Sep 29, 2015
Specify jspm dependencies for moment
@timrwood timrwood merged commit 2eeaed1 into moment:develop Sep 29, 2015
@blixt
Copy link

blixt commented Oct 8, 2015

For me this change increased the minified source of my project by almost 200 kB. It seems that for some reason JSPM is now pulling in a long chain of Node.js shim libraries (base64, zlib, buffer, stream, process, …) and Browserify modules, which clearly aren't necessary for moment to work. Any ideas on how to fix this?

@lookfirst
Copy link
Contributor Author

That makes no sense... this change just makes moment-timezone depend on moment. moment doesn't have any other dependencies...

@blixt
Copy link

blixt commented Oct 9, 2015

@lookfirst Try the following steps in an empty directory and you'll see a big difference between 0.4.0 and 0.4.1:

$ npm init  # just use all the defaults
$ npm install jspm --save-dev
$ jspm init  # just use all the defaults
$ echo "import moment from 'moment-timezone'; console.log(moment().format());" > index.js
# First, let's try v0.4.0
$ jspm install npm:moment-timezone@0.4.0
$ jspm bundle-sfx index index.bundled.js
$ ls -la
# Now, let's try v0.4.1
$ jspm install npm:moment-timezone@0.4.1
$ jspm bundle-sfx index index.bundled.js
$ ls -la

When following the above steps, I see the bundle size going from 105 kB (0.4.0) to 255 kB (0.4.1).

@lookfirst
Copy link
Contributor Author

@blixt I'd file a bug with jspm... that just seems wrong... =(

@blixt
Copy link

blixt commented Oct 9, 2015

@lookfirst Ok I'll file an issue. By the way, why does the dependency specify ~2.6.0 when that version is one and a half years old? Shouldn't the dependency be ^2.10.6 instead to account for current and future minor versions?

@blixt
Copy link

blixt commented Oct 9, 2015

jspm/jspm-cli#1193

@blixt
Copy link

blixt commented Oct 10, 2015

@lookfirst I've been debugging this and I don't think it's jspm's fault. The main reason for the bump in the package size actually seems to be because of #237 which includes the builds directory, which then always gets bundled into the JSPM package no matter if you wanted all the data or not.

@lookfirst
Copy link
Contributor Author

@blixt meh. =( well at least it wasn't my change. =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants